cmake_minimum_required(VERSION 2.6 FATAL_ERROR)

project(Klein)

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS thread REQUIRED)

set(wxWidgets_USE_LIBS base core gl)
find_package(wxWidgets)

if(wxWidgets_FOUND)
	include(${wxWidgets_USE_FILE})
	if(wxWidgets_USE_UNICODE)
		add_definitions(-DUNICODE -D_UNIDODE)
	endif()
endif()

if(MSVC)
	add_definitions(-DNOMINMAX)
endif()

include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_definitions(-DBOOST_DYN_LINK)

include_directories(${wxWidgets_INCLUDE_DIRS})
link_directories(${wxWidgets_LIBRARY_DIRS})

set(KLEIN_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
include_directories(${KLEIN_SOURCE_DIR})

set(KLEIN_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin")
set(KLEIN_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib")
set(KLEIN_INCLUDE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/include")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${KLEIN_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${KLEIN_LIBRARY_OUTPUT_DIRECTORY})

add_subdirectory(Klein)
